/* ----------------------------------------------------------------------
 *	Shadow Quest
 *	Copyright (C) 2009 Prageeth Silva <prageeth@thenewcoders.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *  ----------------------------------------------------------------------
 */
package sq.game;

import java.util.ArrayList;

import org.newdawn.slick.Color;
import org.newdawn.slick.SlickException;

import units.Unit;

public class Team {

    public static final int MAX_TEAMS = 8;
    public static final int MAX_PLAYERS = 4;
    public static final int VILLAGER_TEAM = 0;

    public enum Diplomacy {

        ALLY, NEUTRAL, ENEMY, SAME
    }

    private ArrayList<Unit> teamMembers;
    private int team;
    private Color color;
    private Unit teamLeader;

    public Team(int teamNumber)
            throws SlickException {

        this.teamMembers = new ArrayList<Unit>();
        this.setTeamNumber(teamNumber);

    }

    public Team(int teamNumber, Color color)
            throws SlickException {

        this(teamNumber);
        this.setColor(color);

    }

    private void setTeamNumber(int team) {
        this.team = team;
    }

    public int getTeamNumber() {
        return this.team;
    }

    public Color getColor() {
        return color;
    }

    public final void setColor(Color color) {
        this.color = color;
    }

    public void resetTeamMembers() {
        this.getTeamMembers().clear();
    }

    public ArrayList<Unit> getTeamMembers() {
        return this.teamMembers;
    }

    public int getTeamCount() {
        return this.getTeamMembers().size();
    }

    public void setTeamLeader(Unit unit) {
        this.teamLeader = unit;
    }

    public Unit getTeamLeader() {
        return this.teamLeader;
    }

}
